<template>
	<view class="user-info">
		<view class="img-info">
			<view class="img">
				<image :src="model.icon" mode=""></image>
			</view>
			<view class="text1">
				{{model.nickName}}
			</view>
			<view class="img-text">
				<view class="text1">
					{{model.gender}}
				</view>
				<view class="text1">
					{{model.city}}
				</view>
			</view>
		</view>
		<view class="cu-form-group" @click="Goreport">
			<view class="title">安全公告</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="cu-form-group" @click="Godetail">
			<view class="title">我的订单</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="cu-form-group" @click="stopcar">
			<view class="title">车辆停车</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="cu-form-group">
			<view class="title">我的客服</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="cu-form-group">
			<view class="title">操作说明</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="cu-form-group">
			<view class="title">我的关于</view>
			<view class="cuIcon-right"></view>
		</view>
		<view class="cu-form-group">
			<view class="title">我的版本</view>
			<view class="cuIcon-right"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data(){
			return {
				model:{
					
				}
			}
		},
		methods:{
			getUserinfo() {
				this.model.nickName = uni.getStorageSync('nickName')
				this.model.icon = uni.getStorageSync('avatarUrl')
				this.model.gender = uni.getStorageSync('gender')
				if (this.model.gender == 1) {
					this.model.gender = '男'
				}else {
					this.model.gender = '女'
				}
				this.model.city = uni.getStorageSync('city')
				if (this.model.city == 'Shenzhen') {
					this.model.city = '深圳'
				}
			},
			Goreport() {
				uni.navigateTo({ //成功后跳转到小程序首页，由于没得界面，我就屏蔽了。
					url: '/pages/mycenter/report',
					success: function(res) {},
					fail: function(res) {
						console.log(';21123213', res)
					}
				});
			},
			stopcar() {
				uni.navigateTo({ //成功后跳转到小程序首页，由于没得界面，我就屏蔽了。
					url: '/pages/mycenter/stopcar',
					success: function(res) {},
					fail: function(res) {
						console.log(';21123213', res)
					}
				});
			},
			Godetail() {
				const name = this.model.nickName
				uni.navigateTo({ //成功后跳转到小程序首页，由于没得界面，我就屏蔽了。
					url: '/pages/mycenter/datail?name='+name,
					success: function(res) {},
					fail: function(res) {
						console.log(';21123213', res)
					}
				});
			}	
		},
		created() {
			this.getUserinfo()
		}
	}
</script>

<style lang="scss" scoped>
	.img-info {
		width: 100%;
		height: 250px;
		background-image: url(../../static/beijing.jpg);
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
	}

	.img {
		image {
			width: 100px;
			height: 100px;
			border-radius: 50%;
		}
	}

	.text1 {
		color: #FFFFFF;
		font-size: 20px;
		margin: 0 5px;
	}
	
	.img-text {
		display: flex;
		justify-content: center;
		align-items: center;
	}
</style>
